var whereImg = document.querySelector("#gowhere-neirong");
var OImg1 = document.querySelector(".bgc1");
var sHop = document.querySelector(".shop")




function startMove(obj, target) {
    clearInterval(time);
    time = setInterval(function() {
        var speed = target > getComputedStyle(obj, false)["opacity"] ? 0.01 : -0.01;
        obj.style.opacity = getComputedStyle(obj, false)["opacity"] / 1 + speed;
        if (getComputedStyle(obj, false)["opacity"] / 1 == target) {
            clearInterval(time);
        }
    }, 5);
}
OImg1.onmouseover = function() {
    startMove(OImg1, 0.1);
    sHop.innerHTML = "shop"
}

OImg1.onmouseout = function() {
        startMove(OImg1, 1);
        sHop.innerHTML = ""
    }
    //-------------------------------------
var OImg2 = document.querySelector(".bgc2");
var oCar = document.querySelector(".gwc")

function startMove(obj, target) {
    clearInterval(time);
    time = setInterval(function() {
        var speed = target > getComputedStyle(obj, false)["opacity"] ? 0.01 : -0.01;
        obj.style.opacity = getComputedStyle(obj, false)["opacity"] / 1 + speed;
        if (getComputedStyle(obj, false)["opacity"] / 1 == target) {
            clearInterval(time);
        }
    }, 5);
}

OImg2.onmouseover = function() {
    startMove(OImg2, 0.1);
    oCar.innerHTML = "car";

}

OImg2.onmouseout = function() {
        startMove(OImg2, 1);
        oCar.innerHTML = ""
    }
    //---------------------------------
var OImg3 = document.querySelector(".bgc3");
var oLearn = document.querySelector(".learn")

function startMove(obj, target) {
    clearInterval(time);
    time = setInterval(function() {
        var speed = target > getComputedStyle(obj, false)["opacity"] ? 0.01 : -0.01;
        obj.style.opacity = getComputedStyle(obj, false)["opacity"] / 1 + speed;
        if (getComputedStyle(obj, false)["opacity"] / 1 == target) {
            clearInterval(time);
        }
    }, 5);
}

OImg3.onmouseover = function() {
    startMove(OImg3, 0.1);
    oLearn.innerHTML = "learn";

}

OImg3.onmouseout = function() {
    startMove(OImg3, 1);
    oLearn.innerHTML = ""
}